home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp® 2.0.1 Tutorial / Chapter 06 / UIconEdit.p < prev   
Encoding:
Text File  |  1990-10-25  |  2.2 KB  |  90 lines  |  [TEXT/MPS ]

  1. {Copyright © 1989 by Apple Computer, Inc.  All rights reserved.}
  2.  
  3. UNIT UIconEdit;
  4.  
  5.  
  6. INTERFACE
  7.  
  8.  
  9. USES
  10.     UMacApp;
  11.     
  12.     
  13. CONST kSignature = 'ICED';
  14.       kFileType = 'IDOC'; 
  15.  
  16.  
  17. TYPE 
  18.     TIconApplication = OBJECT(TApplication)
  19.  
  20.         PROCEDURE TIconApplication.IIconApplication(iconFileType: OSType);
  21.             {Initializes the application and globals.}
  22.  
  23.         FUNCTION  TIconApplication.DoMakeDocument(itsCmdNumber: CmdNumber): TDocument; OVERRIDE;
  24.             { Creates a document of type TIconDocument and returns a reference to it.}
  25.  
  26.     END;
  27.  
  28.  
  29.     TIconDocument = OBJECT(TDocument)
  30.     
  31.         fIconBitMap:        TIconBitMap;        { The document’s icon object. }
  32.  
  33.  
  34.         PROCEDURE TIconDocument.IIconDocument;
  35.             { Initializes the document. }
  36.  
  37.         PROCEDURE TIconDocument.Free; OVERRIDE;
  38.             { Frees allocated memory when the document is closed. }
  39.  
  40.         PROCEDURE TIconDocument.DoInitialState; OVERRIDE;
  41.             { Sets the document's data to represent a "new" document. }
  42.  
  43.         PROCEDURE TIconDocument.DoMakeViews(forPrinting: boolean); OVERRIDE;
  44.             { Creates the windows to display the document's data. }
  45.  
  46.     END;
  47.     
  48.     
  49.     TIconBitMap = OBJECT(TObject)
  50.  
  51.         fDataHandle:    Handle;                { Handle to the icon's bit map.            }
  52.  
  53.         PROCEDURE TIconBitMap.IIconBitMap;
  54.             { Initialize the IconBitMap object and allocate space for its data. }
  55.  
  56.         PROCEDURE TIconBitMap.Free; OVERRIDE;
  57.             { Free the icon's bit map. }
  58.             
  59.         PROCEDURE TIconBitMap.SetIconBitMap(theBitMap : Handle);
  60.             { Set the contents of the icon bit map to the new bit map. }
  61.             
  62.         PROCEDURE TIconBitMap.Clear;
  63.             { Clear the icon map by setting its bits to zero. }
  64.             
  65.         PROCEDURE TIconBitMap.Invert;
  66.             { Invert the icon's bit map. }
  67.             
  68.         PROCEDURE TIconBitMap.IconBitToWordBit (iconBit: Point; VAR word, bit: INTEGER);
  69.             { Convert icon bit numbers to the corresponding word and bit number. }
  70.             
  71.         FUNCTION TIconBitMap.GetBit(iconBit: Point): BOOLEAN;
  72.             { Return the state of the given bit. }
  73.             
  74.         PROCEDURE TIconBitMap.SetBit(iconBit: Point; turnBitOn: BOOLEAN);
  75.             { Set the state of the given bit as indicated. }
  76.  
  77.         FUNCTION TIconBitMap.Copy: TIconBitMap;
  78.             { Create a new icon object which is a copy of itself. }
  79.             
  80.         PROCEDURE TIconBitMap.CopyDataTo (anIcon: TIconBitMap);
  81.             { Copy icon data to an existing icon object. }
  82.             
  83.     END;
  84.  
  85.  
  86. IMPLEMENTATION
  87.  
  88.     {$I UIconEdit.inc1.p}
  89.  
  90. END.